Animations
Contents
Show code cell source
%config InlineBackend.rc = {"figure.dpi": 72, 'figure.figsize': (6.0, 4.0)}
%matplotlib inline
import ase
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import HTML
import abtem
abtem.config.set({"local_diagnostics.progress_bar": True});
Animations#
Show code cell source
astigmatism = np.linspace(-70, 70, 50)
astigmatism = np.concatenate([astigmatism, astigmatism[:-1][::-1]])
probe = abtem.Probe(
semiangle_cutoff=30,
defocus=60,
astigmatism=astigmatism,
astigmatism_angle=np.pi / 4,
gpts=256,
extent=10,
energy=200e3,
)
probes = probe.build().complex_images().compute()
[########################################] | 100% Completed | 215.40 ms
astigmatism
array([-70. , -67.14285714, -64.28571429, -61.42857143,
-58.57142857, -55.71428571, -52.85714286, -50. ,
-47.14285714, -44.28571429, -41.42857143, -38.57142857,
-35.71428571, -32.85714286, -30. , -27.14285714,
-24.28571429, -21.42857143, -18.57142857, -15.71428571,
-12.85714286, -10. , -7.14285714, -4.28571429,
-1.42857143, 1.42857143, 4.28571429, 7.14285714,
10. , 12.85714286, 15.71428571, 18.57142857,
21.42857143, 24.28571429, 27.14285714, 30. ,
32.85714286, 35.71428571, 38.57142857, 41.42857143,
44.28571429, 47.14285714, 50. , 52.85714286,
55.71428571, 58.57142857, 61.42857143, 64.28571429,
67.14285714, 70. , 67.14285714, 64.28571429,
61.42857143, 58.57142857, 55.71428571, 52.85714286,
50. , 47.14285714, 44.28571429, 41.42857143,
38.57142857, 35.71428571, 32.85714286, 30. ,
27.14285714, 24.28571429, 21.42857143, 18.57142857,
15.71428571, 12.85714286, 10. , 7.14285714,
4.28571429, 1.42857143, -1.42857143, -4.28571429,
-7.14285714, -10. , -12.85714286, -15.71428571,
-18.57142857, -21.42857143, -24.28571429, -27.14285714,
-30. , -32.85714286, -35.71428571, -38.57142857,
-41.42857143, -44.28571429, -47.14285714, -50. ,
-52.85714286, -55.71428571, -58.57142857, -61.42857143,
-64.28571429, -67.14285714, -70. ])
XXX
visualization = probes.show(cmap="hsluv", display=False, cbar=True, vmin=0, vmax=8e-5)
visualization.adjust_figure_aspect()
visualization.set_panel_labels(
labels="metadata", frameon=False, prop={"color": "w", "fontsize": 12}
)
animation = visualization.animate(adjust_scale=False, interval=100)
HTML(animation.to_jshtml())